#ifndef MY_FUSE_H
#define MY_FUSE_H

#include <fuse.h>
#include <sys/stat.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>
#include <time.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <string.h>
#include <vector>
#include <string>
#include <stack>
#include <iostream>
#include <fstream>
#include <sys/types.h>
#include <unistd.h>
#include <map>
#include <assert.h>

using std::string;
using std::stack;
using std::vector;
using std::cerr;
using std::endl;
using std::map;
using std::ios;
using std::fstream;

//default blocksize = 64K
#define BLOCK_SIZE 	65536
#define MAX_NAME_LEN	256
#define MAX_PATH_LEN	2048

typedef struct
{
	int id;
	char name[MAX_NAME_LEN];
	struct stat stbuf;
	int blk_start;
	int parent;			//the parent of this inode
} inode_t;


typedef struct
{
	char data[BLOCK_SIZE];
	int next;			//if next == -1, it means that there is no further blocks after this
	int valid;			//if valid == 0, it means that this block is free
					//if valid == 1, it means that this block is used by a file
} block_t;

vector<inode_t *> 	inode_table;
vector<block_t *> 	blocks;
map<int, inode_t *> 	dentry_cache;	//this caches all the dentry mappings from inode id to inode address
#endif
